package com.xzt.bookstore.dto;

import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.PositiveOrZero;
import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * 创建图书请求DTO
 */
@Data
public class BookCreateRequest {
    
    @NotBlank(message = "图书名称不能为空")
    private String name;
    
    private String author;
    
    private String isbn;
    
    @NotNull(message = "价格不能为空")
    @PositiveOrZero(message = "价格必须大于等于0")
    private BigDecimal price;
    
    @NotNull(message = "库存不能为空")
    @PositiveOrZero(message = "库存必须大于等于0")
    private Integer stock;
    
    private String description;
    
    private String category;
    
    private String publisher;
    
    private LocalDate publishDate;
    
    /**
     * 状态：0-下架，1-在售，默认为1
     */
    private Integer status = 1;
}

